﻿
/*----------------------------------------------------------------//
// 文件名：MoRoleFunctions.cs
// 文件功能描述：实体 MoRoleFunctions.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoRoleFunctions
using System;
using System.Data;
namespace EQT.Model
{
    /// <summary>
    /// 业务实体MoRoleFunctions
    /// </summary>
    public partial class MoRoleFunctions : ICloneable
    {
        #region 表RoleFunctions的字段
        private string roleId;
        private string funcId;
        #endregion

        #region 构造函数
        public MoRoleFunctions()
        {


        }
        #endregion

        #region 拷贝构造函数

        public MoRoleFunctions(MoRoleFunctions item)
        {
            item.CopyTo(this);
        }
        #endregion

        #region 带参数构造函数
        public MoRoleFunctions(string roleId, string funcId)
        {
            this.roleId = roleId;
            this.funcId = funcId;
        }
        #endregion

        #region 表RoleFunctions的字段属性
        /// <summary>
        /// ROLE_ID
        /// </summary>
        public string RoleId
        {
            get { return roleId; }
            set { roleId = value; }
        }
        /// <summary>
        ///对WINDFORM系统，功能项ID可以ASCII字符串，也可以是数字的字符串格式。目前考虑使用特定编码规则来实现。对WEB系统，功能项应是特定的URL请求或WEBFORM的相对URL编码；
        /// </summary>
        public string FuncId
        {
            get { return funcId; }
            set { funcId = value; }
        }
        #endregion

        #region 辅助函数
        /// <summary>
        /// 拷贝函数
        /// </summary>
        public MoRoleFunctions CopyTo(MoRoleFunctions item)
        {
            item.roleId = this.roleId;
            item.funcId = this.funcId;
            return item;
        }
        /// <summary>
        /// 克隆函数
        /// </summary>		
        public object Clone()
        {
            MoRoleFunctions mo = new MoRoleFunctions();
            mo.RoleId = this.RoleId;
            mo.FuncId = this.FuncId;
            return mo;
        }
        ///<summary>
        ///判断对象是否相等
        ///<summary>
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return true;
            }
            else
            {
                MoRoleFunctions NewRoleFunctions = obj as MoRoleFunctions;
                if (NewRoleFunctions == null)
                {
                    return false;
                }
                else
                {
                    if (NewRoleFunctions.RoleId == this.RoleId && NewRoleFunctions.FuncId == this.FuncId)
                    {
                        return true;
                    }
                }

            }
            return false;

        }
        ///TODO:you should modify GetHashCode by yourself.
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return String.Format(System.Globalization.CultureInfo.InvariantCulture, "RoleId={0}/FuncId={1}", roleId, funcId);

        }
        #endregion


        #region DataTable Help Function
        ///<summary>
        ///DataRow转换成Model
        ///</summary>
        public void Row2Model(DataRow row)
        {
            if (row["Role_ID"] != null && row["Role_ID"] != DBNull.Value)
            {
                this.RoleId = (string)row["Role_ID"];
            }
            else
            {
                this.RoleId = string.Empty;
            }
            if (row["Func_ID"] != null && row["Func_ID"] != DBNull.Value)
            {
                this.FuncId = (string)row["Func_ID"];
            }
            else
            {
                this.FuncId = string.Empty;
            }
        }

        ///<summary>
        ///Model转换成DataRow
        ///</summary>
        public void Model2Row(DataRow row)
        {
            row["Role_ID"] = this.RoleId;
            row["Func_ID"] = this.FuncId;
        }
        #endregion
    }
}
#endregion
